import request from "@/utils/service.js";
// 1.学生数据渲染
export let showStudentList = (page, limit) => {
  return request({
    url: "/allStudent",
    method: "GET",
    params: {
      page,
      limit,
    },
  });
};
// 2.学生用户数据查询
export let inquireStudentList = (keyword) => {
  return request({
    url: `/likeStudent/${keyword}`,
    method: "GET",
    params: {
      keyword,
    },
  });
};
// 3.学生ID数据查询
export let idStudentList = (studentId) => {
  return request({
    url: `/selectStudentOne/${studentId}`,
    method: "GET",
    params: {
      studentId,
    },
  });
};
// 4.学生数据删除
export let delStudentList = (studentId) => {
  return request({
    url: "/deleteStudent",
    method: "DELETE",
    params: {
      studentId,
    },
  });
};
// 5.学生数据添加
export let addStudentList = (
  studentUsername,
  studentName,
  studentClass,
  studentSex,
  studentTel,
  studentCreateTime,
  studentPassword,
  studentAge,
  studentBirthday
) => {
  return request({
    url: "/insertStudent",
    method: "POST",
    data: {
      studentUsername,
      studentName,
      studentClass,
      studentSex,
      studentTel,
      studentCreateTime,
      studentPassword,
      studentAge,
      studentBirthday,
    },
  });
};
// 6.学生数据编辑
export let editStudentList = (
  studentUsername,
  studentName,
  studentClass,
  studentSex,
  studentTel,
  studentPassword,
  studentAge,
  studentBirthday,
  studentId
) => {
  return request({
    url: "/updateStudent",
    method: "POST",
    data: {
      studentUsername,
      studentName,
      studentClass,
      studentSex,
      studentTel,
      studentPassword,
      studentAge,
      studentBirthday,
      studentId,
    },
  });
};
// 7.学生日志数据渲染
export let showStudentLog = (page, limit) => {
  return request({
    url: "/findLog",
    method: "GET",
    params: {
      page,
      limit,
    },
  });
};
// 8.学生日志数据查找
export let inquireStudentLog = (logId, logUsername) => {
  return request({
    url: "/findAllBypageAndNameLike",
    method: "GET",
    params: {
      logId,
      logUsername,
    },
  });
};
// 9.题目总数
export let showQuestionList = () => {
  return request({
    url: "/questionTotal",
    method: "GET",
  });
};
// 10.获取教师列表
export let showTeachertList = (page, limit) => {
  return request({
    url: "/allTeacher",
    method: "GET",
    params: {
      page,
      limit,
    },
  });
};
// 11.教师用户数据查询
export let inquireTeacherList = (keyword) => {
  return request({
    url: `/likeTeacher/${keyword}`,
    method: "GET",
    params: {
      keyword,
    },
  });
};
// 12.教师数据删除
export let delTeacherList = (teacherId) => {
  return request({
    url: "/deleteTeacher",
    method: "DELETE",
    params: {
      teacherId,
    },
  });
};
// 13.教师数据添加
export let addTeacherList = (
  teacherUsername,
  teacherPassword,
  teacherName,
  teacherAge,
  teacherSex,
  teacherBirthday,
  teacherTel,
  teacherClass
) => {
  return request({
    url: "/insertTeacher",
    method: "POST",
    data: {
      teacherUsername,
      teacherPassword,
      teacherName,
      teacherAge,
      teacherSex,
      teacherBirthday,
      teacherTel,
      teacherClass,
    },
  });
};
// 14.教师数据编辑
export let editTeacherList = (
  teacherUsername,
  teacherPassword,
  teacherName,
  teacherAge,
  teacherSex,
  teacherBirthday,
  teacherTel,
  teacherClass,
  teacherId
) => {
  return request({
    url: "/updateTeacher",
    method: "POST",
    data: {
      teacherUsername,
      teacherPassword,
      teacherName,
      teacherAge,
      teacherSex,
      teacherBirthday,
      teacherTel,
      teacherClass,
      teacherId,
    },
  });
};
// 15.教师ID数据查询
export let idTeacherList = (teacherId) => {
  return request({
    url: `/selectTeacherOne/${teacherId}`,
    method: "GET",
    params: {
      teacherId,
    },
  });
};
// 16.获取管理员列表
export let showAdminList = (page, limit) => {
  return request({
    url: "/allAdmins",
    method: "GET",
    params: {
      page,
      limit,
    },
  });
};
// 17.管理员用户数据查询
export let inquireAdminList = (keyword) => {
  return request({
    url: `/likeAdmins/${keyword}`,
    method: "GET",
    params: {
      keyword,
    },
  });
};
// 18.管理员数据删除
export let delAdminList = (adminId) => {
  return request({
    url: "/deleteAdmins",
    method: "DELETE",
    params: {
      adminId,
    },
  });
};
// 19.管理员数据添加
export let addAdminList = (
  adminUsername,
  adminPassword,
  adminName,
  adminAge,
  adminSex,
  adminBirthday,
  adminTel,
  adminCreatetime
) => {
  return request({
    url: "/insertAdmins",
    method: "POST",
    data: {
      adminUsername,
      adminPassword,
      adminName,
      adminAge,
      adminSex,
      adminBirthday,
      adminTel,
      adminCreatetime,
    },
  });
};
// 20.管理员数据编辑
export let editAdminList = (
  adminUsername,
  adminPassword,
  adminName,
  adminAge,
  adminSex,
  adminBirthday,
  adminTel,
  adminCreatetime,
  adminId
) => {
  return request({
    url: "/updateAdmins",
    method: "POST",
    data: {
      adminUsername,
      adminPassword,
      adminName,
      adminAge,
      adminSex,
      adminBirthday,
      adminTel,
      adminCreatetime,
      adminId,
    },
  });
};
// 21.管理员ID数据查询
export let idAdminList = (adminId) => {
  return request({
    url: `/selectOneAdmin/${adminId}`,
    method: "GET",
    params: {
      adminId,
    },
  });
};
